//
//  CustViewCell.m
//  电影er
//
//  Created by dllo on 16/6/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustViewCell.h"
#import "CustHight.h"
#import "CustModel.h"
@interface CustViewCell ()
@property(nonatomic,retain)UILabel *titlelabel;
@property(nonatomic,retain)UILabel *addlabel;
@property(nonatomic,retain)UILabel *tellabel;
@property(nonatomic,retain)UIImageView *imageview;



@end

@implementation CustViewCell


-(void)dealloc{
    [_tellabel release];
    [_addlabel release];
    [_titlelabel release];
    [_imageview release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg_eventlistcell@2x.png"]];
        [self.contentView addSubview:_imageview];
        [_imageview release];
        
        
        self.tellabel = [[UILabel alloc]init];
        [self.imageview addSubview:_tellabel];
        [_tellabel release];
        
        self.titlelabel = [[UILabel alloc]init];
        [self.imageview addSubview:_titlelabel];
        [_titlelabel release];
        
        self.addlabel = [[UILabel alloc]init];
        [self.imageview addSubview:_addlabel];
        [_addlabel release];
        
        
        }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageview.frame = CGRectMake(10, 10, self.contentView.frame.size.width-20, 100);
    self.titlelabel.frame = CGRectMake(10, 5, self.imageview.frame.size.width-20, 30);
    self.titlelabel.font = [UIFont boldSystemFontOfSize:20];
    self.addlabel.frame = CGRectMake(10, 45, self.imageview.frame.size.width-20, 15);
    self.addlabel.numberOfLines =0;
    self.tellabel.frame = CGRectMake(10, 75, 200, 20);
    
    
}

-(void)setCmodel:(CustModel *)cmodel{
    if( _cmodel != cmodel){
        [_cmodel  release];
        [_cmodel retain];
        
    }
    self.titlelabel.text = cmodel.cinemaName;
    self.addlabel.text = cmodel.address;
    
    self.tellabel.text = cmodel.telephone;
    
}


@end
